package worker.control;

import java.util.ArrayList;
import java.util.HashMap;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.multiaction.MultiActionController;

import worker.model.service.SpcService;
import worker.model.vo.StaticsVO;

public class AdminController extends MultiActionController{
	private SpcService spcService;
	public void setSpcService(SpcService spcService) {
		this.spcService = spcService;
	}
	/**
	 * SPC 메뉴 첫 화면
	 */
	public ModelAndView fmb(HttpServletRequest request, HttpServletResponse response){
		System.out.println("admin fmb  join..");
		HashMap map = spcService.getFmbInfoStatics();
		System.out.println(map);
		return new ModelAndView("admin.fmb.fmb_main","map",map);
	}
	/**
	 * 120526 조철희
	 * SPC 메뉴 첫 화면
	 */
	public ModelAndView spc(HttpServletRequest request, HttpServletResponse response){
		System.out.println("main  join..");
		HashMap map = spcService.getSpcInfoStatics();
		System.out.println(map);
		return new ModelAndView("admin.spc.spc_main","map",map);
	}
	/**
	 * day pass and fail quantity
	 * 이주연 추가 - 날짜별 생산, 실패 현황
	 */
	public ModelAndView dpfq(HttpServletRequest request, HttpServletResponse response){
		System.out.println("dpfq");
		ArrayList<StaticsVO> svo= this.spcService.getDayOfPassAndFailQuantity();
		return new ModelAndView("admin.dpfq.DayOfPassAndFailQuantity","svo",svo);
	}

}
